Skip to content

ci: add PR title validation workflow#15

Open
adityamehra wants to merge 1 commit into
mainfrom
feat/add-validate-pr-title-workflow
Open

ci: add PR title validation workflow#15
adityamehra wants to merge 1 commit into
mainfrom
feat/add-validate-pr-title-workflow

Conversation

@adityamehra

Copy link
Copy Markdown
Member

Summary

  • Adds a workflow that enforces Conventional Commits format on all PR titles
  • Based on galileo-python's validate-pr-title.yaml
  • Uses pull_request_target so the check also runs on PRs from forks
  • Pins amannn/action-semantic-pull-request to its commit SHA (0723387faaf9b38adef4775cd42cfd5155ed6017 = v5.5.3) instead of a mutable version tag

How it works

The action validates that every PR title matches the Conventional Commits pattern:

<type>[optional scope]: <description>

Valid types by default: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Examples of passing titles:

  • feat: add OpenAI instrumentation
  • fix(exporter): handle null span context
  • chore: update dependencies

The check re-runs automatically whenever the PR title is edited (edited event type), so contributors can fix a failing title without reopening the PR.

Permissions

Uses only pull-requests: read — the action reads the PR title via the GitHub API and sets a commit status. No write access to repository contents is needed.

Test plan

  • Open a PR with a non-conforming title (e.g. Update stuff) and verify the check fails
  • Edit the title to a valid Conventional Commits format and verify the check passes without reopening the PR
  • Open a PR from a fork and verify the check triggers (requires pull_request_target)

Made with Cursor

Enforces Conventional Commits format on all PR titles using
amannn/action-semantic-pull-request. Action is pinned to its commit SHA
instead of a mutable version tag.

Co-authored-by: Cursor <cursoragent@cursor.com>

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by the Astra agent. It may contain mistakes.

Verdict: approve — Minimal, correctly-configured CI workflow; matches upstream recommended usage with safe permissions and SHA-pinned action.

Follow-ups

Suggested follow-up work that could be tracked as Shortcut stories:

  • .github/workflows/validate-pr-title.yaml:5-8: Consider adding reopened to the trigger types. A PR that is closed with an invalid title and later reopened will not re-run the validation until the next edit or push, leaving a stale/missing status. Adding reopened closes that gap.

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion from the review agent seems to make sense:

Consider adding reopened to the trigger types. A PR that is closed with an invalid title and later reopened will not re-run the validation until the next edit or push, leaving a stale/missing status. Adding reopened closes that gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants